﻿using FCP.Data.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace FCP.Api.Models
{
    public class FCPTableConfigModel
    {
        public FCPTableConfigModel()
        {
            this.Tables = new List<TableConfigModel>();
        }

        public t_form Form { get; set; }

        public List<TableConfigModel> Tables { get; set; }
        public SearchConfigModel SearchConfig { get; set; }
    }

    public class TableConfigModel
    {
        public TableConfigModel()
        {
            this.Fields = new List<TableFieldConfigModel>();
            this.FilterFields = new List<TableFilterFieldConfigModel>();
            this.Panels = new List<TablePanelConfigModel>();
            this.Btns = new List<TableBtnConfigModel>();
            this.RowBtns = new List<TableBtnConfigModel>();
            this.ChildrenCodes = new List<string>();
        }
        public string Code { get; set; }
        public bool IsTop { get; set; }
        public bool HasChildren { get; set; }
        //  public t_form Form { get; set; }

        public t_table Table { get; set; }

        public List<TableFieldConfigModel> Fields { get; set; }

        public List<TableFilterFieldConfigModel> FilterFields { get; set; }

        public List<TablePanelConfigModel> Panels { get; set; }

        public List<TableBtnConfigModel> Btns { get; set; }
        public List<TableBtnConfigModel> RowBtns { get; set; }


        public List<string> ChildrenCodes { get; set; }

    }

    public class TableFieldConfigModel
    {
        public TableFieldConfigModel()
        {
            this.FilterFields = new List<TableFieldFilterFieldConfigModel>();
        }
        public t_table_field Field { get; set; }

        public List<TableFieldFilterFieldConfigModel> FilterFields { get; set; }
    }

    public class TableFieldFilterFieldConfigModel
    {
        public t_table_field_filter_field FilterField { get; set; }
    }

    public class TableFilterFieldConfigModel
    {
        public t_table_filter_field FilterField { get; set; }
    }

    public class TablePanelConfigModel
    {
        public t_table_panel Panel { get; set; }
    }

    public class TableBtnConfigModel
    {
        public t_table_btn Btn { get; set; }
    }
}
